#include "common.h"
#include <getopt.h>
void init_mem(char *img_file);
int parse_args(int argc, char *argv[])
{
    char *img_file = NULL;
    const struct option table[] = {
        {"IMG", required_argument, NULL, 'I'},
        {"NONE", no_argument, NULL, 'N'},
        {0, 0, NULL, 0},
    };
    int o;
    while ((o = getopt_long(argc, argv, "-bhl:d:p:", table, NULL)) != -1)
    {
        switch (o)
        {
        case 'N':
            break;
        case 1:
            img_file = optarg;
            init_mem(img_file);
            return 0;
        default:
            printf("Usage: %s [OPTION...] IMAGE [args]\n\n", argv[0]);
            printf("\t-N,--NONE          none operation\n");
            printf("\n");
            exit(0);
        }
    }

    init_mem(img_file);
    return 0;
}
